import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Home',
      component: () => import('@/views/Home.vue'),
      meta: {
        title: '首页'
      }
    },
    {
      path: '/medical-ai',
      name: 'MedicalAI',
      component: () => import('@/views/MedicalAI.vue'),
      meta: {
        title: 'AI问诊'
      }
    },
    {
      path: '/orders',
      redirect: '/orders/refund'
    },
    {
      path: '/orders/refund',
      name: 'RefundOrder',
      component: () => import('@/views/RefundOrder.vue'),
      meta: {
        title: '退款申请'
      }
    },
    {
      path: '/orders/refund/detail',
      name: 'RefundDetail',
      component: () => import('@/views/RefundDetail.vue'),
      meta: {
        title: '退款详情'
      }
    },
    {
      path: '/orders/medicine',
      name: 'DrugOrders',
      component: () => import('@/views/DrugOrders.vue'),
      meta: {
        title: '药品订单管理'
      }
    },
    {
      path: '/orders/drug-detail/:id',
      name: 'DrugOrderDetail',
      component: () => import('@/views/DrugOrderDetail.vue'),
      meta: {
        title: '药品订单详情'
      }
    },
    {
      path: '/orders/prescription',
      name: 'PrescriptionOrder',
      component: () => import('@/views/PrescriptionOrder.vue'),
      meta: {
        title: '处方订单管理'
      }
    },
    {
      path: '/orders/prescription-detail/:id',
      name: 'PrescriptionOrderDetail',
      component: () => import('@/views/PrescriptionOrderDetail.vue'),
      meta: {
        title: '处方订单详情'
      }
    },
    {
      path: '/orders/interrogation-detail/:id',
      name: 'InterrogationOrderDetail',
      component: () => import('@/views/InterrogationOrderDetail.vue'),
      meta: {
        title: '问诊订单详情'
      }
    },
    {
      path: '/orders/consultation',
      name: 'InterrogationOrder',
      component: () => import('@/views/InterrogationOrder.vue'),
      meta: {
        title: '问诊单管理'
      }
    },
    {
      path: '/orders/registration',
      name: 'RegistrationOrder',
      component: () => import('@/views/RegistrationOrder.vue'),
      meta: {
        title: '挂号单管理'
      }
    },
    {
      path: '/orders/registration-detail/:id',
      name: 'RegistrationOrderDetail',
      component: () => import('@/views/RegistrationOrderDetail.vue'),
      meta: {
        title: '挂号订单详情'
      }
    }
  ],
})

export default router
